package com.example.demo.pojos;

import javax.persistence.*;
import java.util.List;
import java.util.Objects;

@Entity
public class Jpinfo {
    private int jpId;
    private String jpName;
    private String bjls;
    private String jznl;
    private String jzfa;
    private String ys;
    private String ls;
    private String ydcl;
    private String jgfw;
    private String bz;
    private List<Jzgxinfo> jzgx;

    @Id
    @Column(name = "jpId", nullable = false)
    public int getJpId() {
        return jpId;
    }

    public void setJpId(int jpId) {
        this.jpId = jpId;
    }

    @Basic
    @Column(name = "jpName", nullable = true, length = 20)
    public String getJpName() {
        return jpName;
    }

    public void setJpName(String jpName) {
        this.jpName = jpName;
    }

    @Basic
    @Column(name = "bjls", nullable = true, length = 50)
    public String getBjls() {
        return bjls;
    }

    public void setBjls(String bjls) {
        this.bjls = bjls;
    }

    @Basic
    @Column(name = "jznl", nullable = true, length = 10)
    public String getJznl() {
        return jznl;
    }

    public void setJznl(String jznl) {
        this.jznl = jznl;
    }

    @Basic
    @Column(name = "jzfa", nullable = true, length = 50)
    public String getJzfa() {
        return jzfa;
    }

    public void setJzfa(String jzfa) {
        this.jzfa = jzfa;
    }

    @Basic
    @Column(name = "ys", nullable = true, length = 50)
    public String getYs() {
        return ys;
    }

    public void setYs(String ys) {
        this.ys = ys;
    }

    @Basic
    @Column(name = "ls", nullable = true, length = 50)
    public String getLs() {
        return ls;
    }

    public void setLs(String ls) {
        this.ls = ls;
    }

    @Basic
    @Column(name = "ydcl", nullable = true, length = 50)
    public String getYdcl() {
        return ydcl;
    }

    public void setYdcl(String ydcl) {
        this.ydcl = ydcl;
    }

    @Basic
    @Column(name = "jgfw", nullable = true, length = 20)
    public String getJgfw() {
        return jgfw;
    }

    public void setJgfw(String jgfw) {
        this.jgfw = jgfw;
    }

    @Basic
    @Column(name = "bz", nullable = true, length = 100)
    public String getBz() {
        return bz;
    }

    public void setBz(String bz) {
        this.bz = bz;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Jpinfo jpinfo = (Jpinfo) o;
        return jpId == jpinfo.jpId &&
                Objects.equals(jpName, jpinfo.jpName) &&
                Objects.equals(bjls, jpinfo.bjls) &&
                Objects.equals(jznl, jpinfo.jznl) &&
                Objects.equals(jzfa, jpinfo.jzfa) &&
                Objects.equals(ys, jpinfo.ys) &&
                Objects.equals(ls, jpinfo.ls) &&
                Objects.equals(ydcl, jpinfo.ydcl) &&
                Objects.equals(jgfw, jpinfo.jgfw) &&
                Objects.equals(bz, jpinfo.bz);
    }

    @Override
    public int hashCode() {
        return Objects.hash(jpId, jpName, bjls, jznl, jzfa, ys, ls, ydcl, jgfw, bz);
    }

    @OneToMany(mappedBy = "jp")
    public List<Jzgxinfo> getJzgx() {
        return jzgx;
    }

    public void setJzgx(List<Jzgxinfo> jzgx) {
        this.jzgx = jzgx;
    }
}
